<template>
  <div style="padding: 20px">

  <el-form v-model="this.rowData"  :ref="from" label-width="120px">
    <el-form-item label="角色名称:" prop="roleName">
      <el-input v-model="rowData.roleName" autocomplete="off" placeholder="请输入用户名称" style="width: 200px" />
    </el-form-item>
    <el-form-item label="角色描述:" prop="roleDes">
      <el-input v-model="rowData.roleDes" autocomplete="off" placeholder="请描述一下角色职能" style="width: 200px"/>
    </el-form-item>
  </el-form>

      <el-button type="primary" @click="subUpd" style="float: right;">
        提交
      </el-button>

  </div>
</template>

<script>
import axios from "axios";
import {ElMessage} from "element-plus";

export default {
  name: "index",
  props:{
    rowData:{
      type:Object
    }
  },
  methods:{
    subUpd(){
      axios({
        method:"POST",
        url:"http://39.101.199.5:8888/SuJiWords/role/updateRole",
        data: JSON.stringify({"rid": this.rowData.rid,"roleName":this.rowData.roleName, "roleDes":this.rowData.roleDes}),
        headers:{'Content-Type':'application/json;charser=UTF-8'}

      }).then(response => (ElMessage.success(response.data.msg)))
    }
  }
}
</script>

<style scoped>

</style>